﻿using ZQNB.Common.Ioc;

namespace ZQNB.Web.Common.Contexts
{
    public interface INbContextFactory
    {
        NbRequestContext NbRequestContext { get; }
        NbUserContext NbUserContext { get; }
        NbRbacContext NbRbacContext { get; }
        NbThemeContext NbThemeContext { get; }
    }

    public class NbContextFactory : INbContextFactory
    {
        public static INbContextFactory Current
        {
            get
            {
                return CoreServiceProvider.LocateService<INbContextFactory>();
            }
        }

        public NbRequestContext NbRequestContext { get; private set; }
        public NbUserContext NbUserContext { get; private set; }
        public NbRbacContext NbRbacContext { get; private set; }
        public NbThemeContext NbThemeContext { get; private set; }
    }
}